angular.module('faApp')
  .service('companyService', [ 'ajaxService',function (ajaxService) {

    this.companyList = function (cfg) {
      return ajaxService.jsonp(ajaxService.getApiUri("COMPANY_LIST"),cfg || {});
    };  
    
    this.companyAdd = function (item) {
      return ajaxService.post(ajaxService.getApiUri("COMPANY_ADD"),item || {});
    };  

    this.companyEdit = function (item) {
      return ajaxService.post(ajaxService.getApiUri("COMPANY_EDIT"),item || {});
    };  

    this.companyQuery = function (id) {
      return ajaxService.jsonp(ajaxService.getApiUri("COMPANY_QUERY"),{companyId:id});
    };  

    this.companyDelete = function (id) {
      return ajaxService.jsonp(ajaxService.getApiUri("COMPANY_DELETE"),{companyId:id});
    };  

    this.subList = function (cfg) {
      return ajaxService.jsonp(ajaxService.getApiUri("COMPANY_SUB_LIST"),cfg || {});
    };  
}]);
 



